package com.algorithm.prim;

public class Graph {
    int verxs;
    //保存结点
    char[] data;
    //邻接矩阵存放边的权值
    int[][] weight;

    public Graph(int n,char[] c,int[][] w){
        verxs = n;
        setData(c,n);
        setWeight(w,n);

    }

    public void setData(char[] d,int n){
        data = new char[n];
        for(int i = 0;i<data.length;i++){
            data[i] = d[i];
        }
    }

    public void setWeight(int[][] w,int n){
        weight = new int[n][n];
        for(int i = 0;i<weight.length;i++){
            for(int j = 0;j<weight[i].length;j++){
                weight[i][j] = w[i][j];
            }
        }
    }
}
